package logic

import (
	"context"
	"weixin/moble/mysql"

	"weixin/weixinrpc/internal/svc"
	"weixin/weixinrpc/weixinrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CircleShLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCircleShLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CircleShLogic {
	return &CircleShLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CircleShLogic) CircleSh(in *weixinrpc.CircleShRequest) (*weixinrpc.CircleShResponse, error) {
	// todo: add your logic here and delete this line
	var circlesh mysql.Circle
	mysql.DB.Debug().Where("id=?", in.Id).Find(&circlesh)
	return &weixinrpc.CircleShResponse{
		Title:  circlesh.Title,
		UserId: int64(circlesh.UserId),
	}, nil
}
